<?php
    @include_once("common.php");
    $user=$_POST["user"];
    $pwd =$_POST["pwd"];
    $search ="SELECT * FROM `userlist` where user='$user'";
    $result = mysqli_query($conn,$search);
    $item = mysqli_fetch_assoc($result);
    // print_r($item);
    $obj = array();
    if($item) {
        if($item["pwd"]==$pwd){
            $obj["status"]=true;
            $obj["detail"]="登录成功";
        }else{
            $obj["status"]=false;
            $obj["detail"]="账号或密码有误";
        }
    }else {
        $obj["status"]=false;
        $obj["detail"]="账号未注册";
    }
    echo json_encode($obj);
?>